home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
scope
/
151-175
/
scopedisk168
/
asmmacros
/
am_02
/
write.i
< prev
next >
Wrap
Text File
|
1995-03-19
|
2KB
|
75 lines
NOLIST
Write MACRO ; 21 Dec 88
*------------------------------; Start of Write macro.
; Put the file handle in D1.
NOLIST
IFEQ ReEntrant-1
LIST
MOVE.L \3(A5),D1
NOLIST
ENDC
IFNE ReEntrant-1
LIST
MOVE.L \3,D1
NOLIST
ENDC
LIST
; Make D2 point to the start of the buffer.
NOLIST
IFC '\1','D'
LIST
MOVE.L #\2,D2
NOLIST
ENDC
IFC '\1','I'
IFEQ ReEntrant-1
LIST
MOVE.L \2.Adr(A5),D2
NOLIST
ENDC
IFNE ReEntrant-1
LIST
MOVE.L \2.Adr,D2
NOLIST
ENDC
ENDC
IFEQ NARG-3 ; If there is no fourth argument, and
IFC '\1','D' ; <BufferStartAddr> is specified, then
LIST
; Calculate the buffer size as
; <BufferStartAddr>End minus
; <BufferStartAddr>. Put it in D3.
MOVE.L #\2End-\2,D3
NOLIST
ENDC
IFC '\1','I' ; If <MemBlockName> is specified, then
LIST
; Get the buffer size from <MemBlockName>.Size
NOLIST
IFEQ ReEntrant-1
LIST
MOVE.L \2.Size(A5),D3
NOLIST
ENDC
IFNE ReEntrant-1
LIST
MOVE.L \2.Size,D3
NOLIST
ENDC
ENDC
ENDC
IFEQ NARG-4 ; If the fourth argument exists,
IFNC '\4','D3' ; and it is not "D3", then
LIST
; Use the buffer size of the fourth argument.
MOVE.L #\4,D3
NOLIST
ENDC
ENDC
LIST
CallLib Write,dos ; Call Write.
CMPI.L #-1,D0 ; Make the zero flag indicate failure.
*------------------------------; End of Write macro.
ENDM
LIST